// 通用类型定义
export interface Pagination {
  current: number
  pageSize: number
  total: number
}

export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
}

// 用户认证相关类型
export interface LoginForm {
  username: string
  password: string
}

export interface UserInfo {
  id: number
  username: string
  nickname: string
  email?: string
  phone?: string
  avatar?: string
  role: 'admin' | 'beautician'
  createdAt: string
}

// 美容项目类型
export interface BeautyProject {
  id: number
  name: string
  description: string
  duration: number // 分钟
  price: number
  imageUrl?: string
  status: 1 | 0
  createdAt: string
  updatedAt: string
}

// 产品分类类型
export interface ProductCategory {
  id: number
  name: string
  description?: string
  sortOrder: number
  status: 'active' | 'inactive'
  createdAt: string
}

// 美容产品类型
export interface BeautyProduct {
  id: number
  name: string
  category: number
  description: string
  price: number
  stockQuantity: number
  image?: string
  status: 1 | 0
  createdAt: string
  updatedAt: string
}

// 会员类型
export interface Member {
  id: number
  name: string
  phone: string
  password?: string
  email?: string
  birthday?: string
  memberLevel: 'regular' | 'silver' | 'gold' | 'platinum'
  points: number
  totalConsumption: number
  balance: number
  avatar?: string
  status: 'active' | 'inactive'
  createdAt: string
  lastVisit?: string
}

// 销售记录类型
export interface SaleRecord {
  id: number
  memberId?: number
  memberName?: string
  productId: number
  productName: string
  quantity: number
  unitPrice: number
  totalAmount: number
  discountAmount?: number
  finalAmount: number
  paymentMethod: 'cash' | 'wechat' | 'alipay' | 'card'
  status: 'completed' | 'refunded' | 'cancelled'
  createdAt: string
  createdBy: string
}

// 预约类型
export interface Appointment {
  id: number
  memberId: number
  memberName: string
  memberPhone: string
  projectId: number
  projectName: string
  beauticianId: number
  beauticianName: string
  appointmentDate: string
  duration: number
  status: 'pending' | 'confirmed' | 'completed' | 'cancelled'
  notes?: string
  createdAt: string
  updatedAt: string
}

// 美容师职位枚举
export enum BeauticianPosition {
  CHIEF = '首席美容师',
  SENIOR = '高级美容师',
  PROFESSIONAL = '专业美容师',
  CONSULTANT = '美容顾问',
  INTERMEDIATE = '中级美容师',
  JUNIOR = '初级美容师'
}

// 美容师类型
export interface Beautician {
  id?: number
  name: string
  position: BeauticianPosition
  experience: number
  specialty?: string
  imageUrl?: string
  phone?: string
  email?: string
  status: 1 | 0
  createdAt?: string
  updatedAt?: string
}

// 美容师排班类型
export interface BeauticianSchedule {
  id?: number
  beauticianId: number
  weekDay: number
  startTime: string
  endTime: string
  maxAppointments: number
  currentAppointments: number
  status: 1 | 0 | 2
  notes?: string
  createdAt?: string
  updatedAt?: string
}